package com.vogue.supplymall.common.domain.validate;

import javax.validation.Constraint;  
import javax.validation.Payload;  
import java.lang.annotation.Documented;  
import java.lang.annotation.Retention;  
import java.lang.annotation.Target;  
import static java.lang.annotation.ElementType.*;  
import static java.lang.annotation.RetentionPolicy.*; 

@Target({ FIELD, METHOD, PARAMETER, ANNOTATION_TYPE })  
@Retention(RUNTIME)  
//指定验证器  
@Constraint(validatedBy = NotEmptyValidator.class)  
@Documented  
/**
 * 为空验证 空字符串无效
 * @author Administrator
 *
 */
public @interface NotEmpty {

	//默认错误消息  
    String message() default "{forbidden.word}";  
  
    //指定的属性名
    String name() default "name";
    
    //分组  
    Class<?>[] groups() default { };  
  
    //负载  
    Class<? extends Payload>[] payload() default { };  
  
    //指定多个时使用  
    @Target({ FIELD, METHOD, PARAMETER, ANNOTATION_TYPE })  
    @Retention(RUNTIME)  
    @Documented  
    @interface List {  
    	NotEmpty[] value();  
    }  
    
}
